package cz.uhk.ppro.entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

@Entity
public class Dil implements Serializable {
	/**
	 * Skladová položka
	 */
	private static final long serialVersionUID = 1L;
	private String katalogoveCislo, poznamka, nazev;
	@Id
	@GeneratedValue
	private int id;
	
	private int pocetKusu;
	@ManyToOne
	@JoinColumn(name = "idDodavatele")
	private Dodavatel dodavatel;
	@ManyToMany
	@JoinTable(
            name="prirazenistitku",
            joinColumns = @JoinColumn( name="idDilu"),
            inverseJoinColumns = @JoinColumn( name="idStitku")
    )
	private List<Stitek> stitky;
	private float cenaKc,cenaEur,cenaUsd;
	
	public Dil(){
		stitky = new ArrayList<Stitek>();
		
	}

	public String getKatalogoveCislo() {
		return katalogoveCislo;
	}

	public void setKatalogoveCislo(String katalogoveCislo) {
		this.katalogoveCislo = katalogoveCislo;
	}

	public String getPoznamka() {
		return poznamka;
	}

	public void setPoznamka(String poznamka) {
		this.poznamka = poznamka;
	}

	public String getNazev() {
		return nazev;
	}

	public void setNazev(String nazev) {
		this.nazev = nazev;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getPocetKusu() {
		return pocetKusu;
	}

	public void setPocetKusu(int pocetKusu) {
		this.pocetKusu = pocetKusu;
	}

	public float getCenaKc() {
		return cenaKc;
	}

	public void setCenaKc(float cenaKc) {
		this.cenaKc = cenaKc;
	}

	public float getCenaEur() {
		return cenaEur;
	}

	public void setCenaEur(float cenaEur) {
		this.cenaEur = cenaEur;
	}

	public float getCenaUsd() {
		return cenaUsd;
	}

	public void setCenaUsd(float cenaUsd) {
		this.cenaUsd = cenaUsd;
	}

	public Dodavatel getDodavatel() {
		return dodavatel;
	}

	public void setDodavatel(Dodavatel dodavatel) {
		this.dodavatel = dodavatel;
	}

	public List<Stitek> getStitky() {
		return stitky;
	}

	public void setStitky(List<Stitek> stitky) {
		this.stitky = stitky;
	}
}
